package com.shiwen.wiki.controller;


import com.shiwen.wiki.domain.Test;
import com.shiwen.wiki.mapper.TestMapper;
import com.shiwen.wiki.service.TestService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class testController {

    @Value("${test.hello:bbbbbbbbbbbbbbb}")
    private String test;
    @GetMapping("/hello")
    public String hello(){
        return "hello world!"+test;
    }

    @PostMapping("/hello/post")
    public String helloPost(String name){
        return "hello world! post,"+name;
    }

    @Resource
    private TestService testService;
    @GetMapping("/test/list")
    public List<Test> list(){
        return testService.list();
    }
}
